/*
Package grf
@Author   : Uyynot
@Email    : uyynot@qq.com
@Time     : 2024/6/13 14:24
@File     : main.go
@Project  : grf
@Desc     :
*/
package main

import (
	"grf/config"
	"grf/pkg/logger"
	"grf/pkg/timeutil"
)

func main() {
	loggerCvg := config.Get().Logger
	//初始化logger
	accessLogger, err := logger.NewJsonLogger(
		logger.WithDisableConsole(),
		logger.WithTimeLayout(timeutil.CSTLayout),
		logger.WithFileRotationp(loggerCvg.Access),
	)
	if err != nil {
		panic(err)
	}
	//初始化定时任务logger
	cronLogger, err := logger.NewJsonLogger(
		logger.WithDisableConsole(),
		logger.WithTimeLayout(timeutil.CSTLayout),
		logger.WithFileRotationp(loggerCvg.Access),
	)
	if err != nil {
		panic(err)
	}

	defer func() {
		_ = accessLogger.Sync()
		_ = cronLogger.Sync()
	}()

}
